package ar.com.ford.it.fullEconomics.struct;

import ar.com.ford.it.fullEconomics.persistence.dto.Ncas101CatalogVw;

public class MixProcessVolumeStruct {

	private Ncas101CatalogVw ncas101CatalogVw;

	private Integer volumen;

	public MixProcessVolumeStruct(Ncas101CatalogVw ncas101CatalogVw, Integer volumen) {
		this.ncas101CatalogVw = ncas101CatalogVw;
		this.volumen = volumen;
	}

	public Ncas101CatalogVw getNcas101CatalogVw() {
		return ncas101CatalogVw;
	}

	public void setNcas101CatalogVw(Ncas101CatalogVw ncas101CatalogVw) {
		this.ncas101CatalogVw = ncas101CatalogVw;
	}

	public Integer getVolumen() {
		return volumen;
	}

	public void setVolumen(Integer volumen) {
		this.volumen = volumen;
	}

	/**
	 * compara los catalogos
	 */
	public boolean equals(Object objeto) {

		try {
			// Casteo el objeto
			MixProcessVolumeStruct mixProcessVolumeStruct = (MixProcessVolumeStruct) objeto;

			// Obtengo la parte
			Ncas101CatalogVw ncas101CatalogVw = mixProcessVolumeStruct
					.getNcas101CatalogVw();

			if (ncas101CatalogVw.getCas101CatalModelyearCodeC().equals(
					this.ncas101CatalogVw.getCas101CatalModelyearCodeC())
					&& ncas101CatalogVw.getCas101CatalTmaCodeC().equals(
							this.ncas101CatalogVw.getCas101CatalTmaCodeC())
					&& ncas101CatalogVw.getCas101CatalSeqCodeC().equals(
							this.ncas101CatalogVw.getCas101CatalSeqCodeC())) {
				return true;
			} else {
				return false;
			}

		} catch (Exception e) {
			return false;
		}
	}
	
	public String getCatalogIDString() {
		
		String ret = this.getNcas101CatalogVw().getCas101CatalModelyearCodeC()
		+ "/"
		+ this.getNcas101CatalogVw().getCas101CatalTmaCodeC()
		+ "/"
		+ this.getNcas101CatalogVw().getCas101CatalSeqCodeC();
		
		return ret;
	}

}
